My admittedly obsessive quest to minimize clicks and
keystrokes is a quirk, I know, but it’s a defensible one (I keep
telling myself). After all, the fewer mouse and keyboard moves you have
to make—particularly when you’re doing day-to-day system drudgery—the
more time you have for being a productive member of society.
Unfortunately,
the technique I’m about to show you isn’t a great example of this
because I’m talking here about reducing the number of clicks it takes
to restart and shut down Windows 7, and how often does anyone do that
in the course of a day? Still, I really like this tip because it just
bugs me that I have to display the Startstop
Windows 7 (which is just senseless), and it takes two clicks to do it.
Bah! In this section, you learn how to restart and shut down Windows
with just one measly click. menu to
At the heart of this technique is the SHUTDOWN command, which you can use to restart or shut down your computer . Here’s the full syntax:
SHUTDOWN [[/R] | [/S] | [/L] | [/H] | [/I] | [/P] | [/E] | [/A]] [/F] | [/T seconds] [/D [P:]xx:yy] [/M \\ComputerName] [/C "comment"]
/R | Restarts the computer. |
/S | Shuts down the computer. |
/L | Logs off the current user immediately. |
/H | Puts the computer into hibernation, if the computer supports hibernation mode. |
/I | Displays the Remote Shutdown dialog box, which enables you to specify many of the options provided by these switches. |
/P | Turns off the local computer immediately (that is, without the usual warning interval). |
/E | Enables you to document the reason for an unexpected shutdown. |
/A | Cancels the pending restart or shutdown. |
/F | Forces
all running programs on the target computer to shut down without
warning. This, obviously, is dangerous and should be used only as a
last resort. |
/D [P:]major:minor] | Specifies the reason for the shutdown. Include P: to indicate the shutdown is planned. Use values between 0 and 255 for major and between 0 and 65535minor. Windows also defines a number of predefined values for the majorminor parameters: for and |
| major | minor | Reason |
| 0 | 0 | Other (Planned) |
| 0 | 5 | Other Failure: System Unresponsive |
| 1 | 1 | Hardware: Maintenance (Unplanned) |
| 1 | 1 | Hardware: Maintenance (Planned) |
| 1 | 2 | Hardware: Installation (Unplanned) |
| 1 | 2 | Hardware: Installation (Planned) |
| 2 | 3 | Operating System: Upgrade (Planned) |
| 2 | 4 | Operating System: Reconfiguration (Unplanned) |
| 2 | 4 | Operating System: Reconfiguration (Planned) |
| 2 | 16 | Operating System: Service Pack (Planned) |
| 2 | 17 | Operating System: Hot Fix (Unplanned) |
| 2 | 17 | Operating System: Hot Fix (Planned) |
| 2 | 18 | Operating System: Security Fix (Unplanned) |
| 2 | 18 | Operating System: Security Fix (Planned) |
| 4 | 1 | Application: Maintenance (Unplanned) |
| 4 | 1 | Application: Maintenance (Planned) |
| 4 | 2 | Application: Installation (Planned) |
| 4 | 5 | Application: Unresponsive |
| 4 | 6 | Application: Unstable |
| 5 | 15 | System Failure: Stop Error |
| 5 | 19 | Security Issue |
| 5 | 19 | Security Issue |
| 5 | 19 | Security Issue |
| 5 | 20 | Loss of Network Connectivity (Unplanned) |
| 6 | 11 | Power Failure: Cord Unplugged |
| 6 | 12 | Power Failure: Environment |
| 7 | 0 | Legacy API Shutdown |
/M \\ComputerName | Specifies the remote computer you want to shut down. |
/T seconds | Specifies
the number of seconds after which the computer is shut down. The
default is 30 seconds, and you can specify any number up to 600. |
/C "comment" | The comment text (which can be a maximum of 127 characters) appears in the dialog box and warns the user of the pending shutdown. This comment text also appears in the shutdown event that is added to the System log in Event Viewer. (Look for an Event ID of 1074.) |
For example, to restart your computer immediately, use the following command:
If you’ve launched a restart or shutdown using some nonzero value for /T, and you need to cancel the pending shutdown, run SHUTDOWN with the /A switch before the timeout interval is over:
Create a Restart Shortcut
Okay, let’s use our newfound knowledge of the SHUTDOWN command to set up Windows 7 with one-click restarts:
1. | Right-click an empty section of the desktop, and then select New, Shortcut. The Create Shortcut Wizard appears.
|
2. | In the text box, type shutdown /r /t 0, as shown in Figure 1.
|
3. | Click Next. The Create Shortcut wizard prompts you to enter a name for the shortcut.
|
4. | Type a name (such as The Amazing One-Click Restart Thingy) and then click Finish.
|
5. | Right-click the new shortcut and then click Properties. The shortcut’s property sheet appears.
|
6. | In the Shortcut tab, click Change Icon. Windows tells you that shutdown.exe contains no icons.
|
7. | Click OK. The Change Icon dialog box appears.
|
8. | Click an icon that looks “restart-y” and then click OK.
|
9. | Click OK. Windows applies the new icon to the shortcut.
|
10. | Right-click
the shortcut and then click Pin to Taskbar. Windows 7 adds your icon to
the taskbar, and restarts are now just a click away.
|
Create a Shutdown Shortcut
I think you know what comes next, right? Follow these very similar steps to add a shutdown shortcut to the Quick Launch toolbar:
1. | Right-click an empty section of the desktop, and then select New, Shortcut. The Create Shortcut Wizard appears.
|
2. | In the text box, type shutdown /s /t 0.
|
3. | Click Next. The Create Shortcut wizard prompts you to enter a name for the shortcut.
|
4. | Type a name (such as The Amazing One-Click Shutdown Whatsit) and then click Finish.
|
5. | Right-click the new shortcut and then click Properties. The shortcut’s property sheet appears.
|
6. | In the Shortcut tab, click Change Icon. Windows tells you that shutdown.exe contains no icons.
|
7. | Click OK. The Change Icon dialog box appears.
|
8. | Click an icon that looks “shutdown-y” and then click OK.
|
9. | Click OK. Windows applies the new icon to the shortcut.
|
10. | Right-click
the shortcut and then click Pin to Taskbar. Windows 7 adds your icon to
the taskbar, and restarts are now just a click away. |